package test;

import java.io.File;

/**
 * @author suwy
 * @date 2014-3-10
 * @todo TODO
 */
public class ChangeFileName {

	private static String folder = "H:/MyFiles/work/media/网站掠影2/";
	
	private void changeName() {
		File file = new File(folder);
		File[] files = file.listFiles();
		for (int i = 0; i < files.length; i++) {
			if(files[i].getName().indexOf(".JPG") > 0) {
				files[i].renameTo(new File(folder + (i+1 + ".jpg")));
//				System.out.println();
			}
		}
	}
	
	public static void main(String[] args) {
		ChangeFileName changeFileName = new ChangeFileName();
		changeFileName.changeName();
	}

}
